From e3fa514525504565adcdf2ea9cf79ab218ef53dd Mon Sep 17 00:00:00 2001 From: "rneugeba@wyvis.research.intel-research.net" Date: Tue, 1 Mar 2005 13:47:27 +0000 Subject: [PATCH] bitkeeper revision 1.1240 (4224726fJ1qampcdzMTCSrPkcOif_w) minor tweak Signed-off-by: michael.fetterman@cl.cam.ac.uk --- xen/arch/x86/mm.c | 20 ++++++++------------ xen/arch/x86/x86_32/asm-offsets.c | 7 +++++-- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c index 1f577e98c0..a8c72861ff 100644 --- a/xen/arch/x86/mm.c +++ b/xen/arch/x86/mm.c @@ -1689,10 +1689,8 @@ int do_mmu_update( perfc_incrc(calls_to_mmu_update); perfc_addc(num_page_updates, count); /* - * do a histogram for count. - * first bucket is for count=0, - * second bucket is for count=1 - * last bucket is for count >= 63 * PERFC_PT_UPDATES_BUCKET_SIZE + * histogram: special treatment for 0 and 1 count. After that equally + * spaced with last bucket taking the rest. */ if ( count == 0 ) { @@ -1700,10 +1698,10 @@ int do_mmu_update( } else if ( count == 1 ) { perfc_incra(bpt_updates, 1); - } else if ( (count / PERFC_PT_UPDATES_BUCKET_SIZE) + } else if ( ((count-2) / PERFC_PT_UPDATES_BUCKET_SIZE) < (PERFC_MAX_PT_UPDATES - 3) ) { - perfc_incra(bpt_updates, (count / PERFC_PT_UPDATES_BUCKET_SIZE) + 2); + perfc_incra(bpt_updates, ((count-2)/PERFC_PT_UPDATES_BUCKET_SIZE) + 2); } else { perfc_incra(bpt_updates, PERFC_MAX_PT_UPDATES - 1); @@ -2371,10 +2369,8 @@ void ptwr_flush(const int which) #ifdef PERF_COUNTERS /* - * do a histogram for count. - * first bucket is for count=0, - * second bucket is for count=1 - * last bucket is for count >= 63 * PERFC_PT_UPDATES_BUCKET_SIZE + * histogram: special treatment for 0 and 1 count. After that equally + * spaced with last bucket taking the rest. */ if ( count == 0 ) { @@ -2382,10 +2378,10 @@ void ptwr_flush(const int which) } else if ( count == 1 ) { perfc_incra(wpt_updates, 1); - } else if ( (count / PERFC_PT_UPDATES_BUCKET_SIZE) + } else if ( ((count-2) / PERFC_PT_UPDATES_BUCKET_SIZE) < (PERFC_MAX_PT_UPDATES - 3) ) { - perfc_incra(wpt_updates, (count / PERFC_PT_UPDATES_BUCKET_SIZE) + 2); + perfc_incra(wpt_updates, ((count-2)/PERFC_PT_UPDATES_BUCKET_SIZE) + 2); } else { perfc_incra(wpt_updates, PERFC_MAX_PT_UPDATES - 1); diff --git a/xen/arch/x86/x86_32/asm-offsets.c b/xen/arch/x86/x86_32/asm-offsets.c index 4a609826a1..a91692e3c6 100644 --- a/xen/arch/x86/x86_32/asm-offsets.c +++ b/xen/arch/x86/x86_32/asm-offsets.c @@ -5,6 +5,7 @@ */ #include +#include #define DEFINE(_sym, _val) \ __asm__ __volatile__ ( "\n->" #_sym " %0 " #_val : : "i" (_val) ) @@ -69,6 +70,8 @@ void __dummy__(void) DEFINE(FIXMAP_apic_base, fix_to_virt(FIX_APIC_BASE)); - OFFSET(PERFC_hypercalls, struct perfcounter_t, hypercalls); - OFFSET(PERFC_exceptions, struct perfcounter_t, exceptions); +#if PERF_COUNTERS + OFFSET(PERFC_hypercalls, struct perfcounter, hypercalls); + OFFSET(PERFC_exceptions, struct perfcounter, exceptions); +#endif } -- 2.30.2